﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace dodone
{
	/// <summary>
	/// CalendarDayPanel.xaml에 대한 상호 작용 논리
	/// </summary>
	public partial class CalendarDayPanel : UserControl
	{
		private CalendarWindow ancestorWindow;

		public CalendarDayPanel()
		{
			InitializeComponent();
		}

		public void prtDayCal(DateTime iDay)
		{
			SolarToLunaDate lunaDate = new SolarToLunaDate(iDay);
			int fWeek = (int)iDay.DayOfWeek;
			string LunaStr = "";
			
			switch (fWeek)
			{
				case 0:
					lblDayPanelWeek.Content = "일요일";
					break;
				case 1:
					lblDayPanelWeek.Content = "월요일";
					break;
				case 2:
					lblDayPanelWeek.Content = "화요일";
					break;
				case 3:
					lblDayPanelWeek.Content = "수요일";
					break;
				case 4:
					lblDayPanelWeek.Content = "목요일";
					break;
				case 5:
					lblDayPanelWeek.Content = "금요일";
					break;
				case 6:
					lblDayPanelWeek.Content = "토요일";
					break;
				default:
					// never execute this statement
					break;
			}

			LunaStr += " [음력 ";

			if (lunaDate.IsLeapMonth == true)
				LunaStr += "(윤) ";

			LunaStr += lunaDate.LunaMonth.ToString() + "월 " + lunaDate.LunaDay.ToString() + "일]";

			lblDayPanelLuna.Content = LunaStr;
		}

		public CalendarWindow AncestorWindow
		{
			get { return ancestorWindow; }
			set { ancestorWindow = value; }
		}
	}
}
